package com.tongcao.cn.validator.exception;

/**
 * @Author:tongcao
 * @Date:2019/4/26 16:52
 * Description:
 */
public class ValidatorException extends RuntimeException {

    private String code;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public ValidatorException() {
        super();
    }

    /**
     * 根据异常信息和原生异常构造对象.
     *
     * @param message
     *            异常信息.
     * @param cause
     *            原生异常.
     */
    public ValidatorException(final String message, final Throwable cause) {
        super(message, cause);
    }

    /**
     * 根据异常信息构造对象.
     *
     * @param message
     *            异常信息.
     */
    public ValidatorException(final String message) {
        super(message);
    }

    /**
     * 根据异常信息和原生异常构造对象.
     *
     * @param message
     *            异常信息.
     * @param cause
     *            原生异常.
     */
    public ValidatorException(final String code,final String message, final Throwable cause) {
        super(message, cause);
        this.code = code;
    }

    /**
     * 根据异常信息构造对象.
     *
     * @param message
     *            异常信息.
     */
    public ValidatorException(final String code,final String message) {
        super(message);
        this.code = code;
    }





    /**
     * 根据原生异常构造对象.
     *
     * @param cause
     *            原生异常.
     */
    public ValidatorException(final Throwable cause) {
        super(cause);
    }

    @Override
    public synchronized Throwable fillInStackTrace() {
        return this;
    }
}